Programming the Microsoft Bot Framework: A Multiplatform Approach to Building Chatbots (Developer Reference) by Joe Mayo

Programming the Microsoft Bot Framework: A Multiplatform Approach to Building Chatbots (Developer Reference) by Joe Mayo

Author:Joe Mayo [Mayo, Joe]
Language: eng
Format: epub
Publisher: Pearson Education
Published: 2017-11-21T00:00:00+00:00


In its simplest form, the Field method has an overload that only requires the name of a field, as in the following excerpt from Listing 7-4:

Click here to view code image

var form = new FormBuilder<WineForm>() .Message(“Welcome to WineBot!”) .Field(nameof(InStock), wineForm => DateTime.Now.DayOfWeek == DayOfWeek.Wednesday);

This Field defines the InStock field. Additionally, it uses an optional active parameter, which is an ActiveDelegate instance, as described in the previous Message method section. Since the default FormFlow behavior is to order properties based on their declared order in the class, this is one way to change the order of fields from the default. In this example, the default ordering is to ask the WineType field question first, because it appears first in the class, but using the Field method makes the InStock field question show first instead.

The first time you use the Field method, it overrides the default FormFlow behavior, requiring explicitly using a Field method for each field. In the following sections, you’ll learn how to dyamically add, exclude, and fill in remaining fields.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.